<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//二维数组
			var food = [
				["土豆", "青菜", "海带", "娃娃菜"],
				["草莓", "樱桃", "香蕉", "哈密瓜"],
				["面条", "拌粉", "饺子", "螺蛳粉"]
			];
			for (i = 0, len = food.length; i < len; i++) {
				if(i == 0){
					document.write("蔬菜");
					document.write("<br />");
				}else if(i == 1){
					document.write("水果");
					document.write("<br />");
				}else if(i == 2){
					document.write("主食");
					document.write("<br />");
				}
				for (j = 0, len2 = food[i].length; j < len2; j++){
					document.write(food[i][j]);
					document.write("<br />");
				}
			}
		</script>
	</body>
</html>
